package com.example.demo.app.service.impl;

import com.example.demo.api.dto.StudentGradeDTO;
import com.example.demo.app.repository.GradesRepository;
import com.example.demo.app.service.GradesService;
import com.example.demo.domain.entity.Grades;
import com.example.demo.domain.vo.StudentGradesSimpleVo;
import com.example.demo.infra.mapper.GradesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class GradesServiceImpl implements GradesService {
    @Autowired
    private GradesRepository gradesRepository;
    @Override
    public List<StudentGradeDTO> queryGradesByCondition(Integer studentId, Integer teacherId, Integer courseId) {
        return gradesRepository.queryGradesByCondition(studentId, teacherId, courseId);
    }

    @Override
    public Integer deleteByStudentIdInteger(List<Integer> ids) {
        return gradesRepository.deleteByStudentIdInteger(ids);
    }

    @Override
    public List<StudentGradesSimpleVo> queryStudentGradesSimple() {
        return gradesRepository.queryStudentGradesSimple();
    }

    @Override
    public Integer updateScore(Integer studentId, Integer courseId, Integer score) {
        return gradesRepository.updateScore(studentId, courseId, score);
    }
}
